<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class DeviceType extends Model
{
    protected $table = 't_devicetype';
    
    protected $primaryKey = 'dt_index';
    
    protected $fillable = ['dt_typeid','dt_typename','dt_issupportext','dt_isenable','dt_rtdata_table','dt_hisdata_table','dt_typememo', 'dt_icon'];
    
    public $timestamps = false;
    
    protected $casts = [
        'value'=>'integer',
        'dt_typeid'=>'integer',
        'dt_issupportext'=>'boolean',
        'dt_isenable'=>'boolean',
    ];

    public function children() {
        return $this->hasMany('\App\Models\Subdevicetype', 'ts_Maintypeid', 'dt_typeid');
    }
}
